/**
teachingJournal.js
 * 鉴权action, 描述鉴权相关的用户行为
 *
 * created by xurui
 * version 1.0.0
 * 2016年03月29日
 */
import { create } from './asyncActionCreator';

import {TEACHING_JOURNAL_URL} from '../../../constants/API';

export const SELECT_TEACHERS_INFORMATION_PAGE = 'select teachers information page';
export const selectTeachersInformationPage = (currentPageIndex) => ({
	type:SELECT_TEACHERS_INFORMATION_PAGE,
	payload:{
		currentPageIndex
	}
})
/**
 * 异步获取教师详细信息
 * @type {String}
 */
export const GET_DETAIL_REQUEST = 'get teachingJournal detail request',
			 GET_DETAIL_SUCCESS = 'get teachingJournal detail success',
			 GET_DETAIL_FALIURE = 'get teachingJournal detail faliure';

export const getDetailRequest = () => ({
	type:GET_DETAIL_REQUEST,
	payload:{
		
	}
});

export const getDetailSuccess = ({list,total_count,page_count}) => ({
	type:GET_DETAIL_SUCCESS,
	payload:{
		detail:list,
		pageSize:total_count,
		pageIndex:page_count
	}
});

export const getDetailFaliure = (errorMessage) => ({
	type:GET_DETAIL_FALIURE,
	payload:{
		errorMessage
	}
});

export const getDetail = (params) => {
	return create(`${TEACHING_JOURNAL_URL}`,
		getDetailRequest,
		getDetailSuccess,
		getDetailFaliure,
		params)
}

